<script>
	export default {
		onLaunch: function() {
			const that = this
			that.$scope.globalData.url = "https://www.zadker.com"
			uni.getSystemInfo({
				success:function(e){
					console.log(e)
					if(e.model=="PC"){
						that.$scope.globalData.env="PC"
					}else{
						that.$scope.globalData.env="MP"
						uni.login({
							provider: 'weixin',
							success: function(loginRes) {
								uni.request({
									url: getApp().globalData.url + '/api/user/code2Session?code=' + loginRes.code,
									header: {
										'content-type': 'application/json'
									},
									success: (res) => {
										if (res.data.code == "00000") {
											getApp().globalData.user = res.data.data.user;
											getApp().globalData.token = res.data.data.token;
											that.$isResolve()
										}
									}
								});
							}
						});
					}
				}
			});
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/* #ifndef APP-PLUS-NVUE */
	/* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
	@import '@/static/uni.css';
	@import '@/static/customicons.css';
	/* H5 兼容 pc 所需 */
	/* #ifdef H5 */
	@media screen and (min-width: 768px) {
		body {
			overflow-y: scroll;
		}
	}
	/* 顶栏通栏样式 */
	/* .uni-top-window {
	    left: 0;
	    right: 0;
	} */
	uni-page-body {
		background-color: #F5F5F5 !important;
		min-height: 100% !important;
		height: auto !important;
	}
	.uni-top-window uni-tabbar .uni-tabbar {
		background-color: #fff !important;
	}
	.uni-app--showleftwindow .hideOnPc {
		display: none !important;
	}
	/* #endif */
	
	/* #endif*/
</style>